/**
 * <copyright>
 * </copyright>
 *

 */
package br.ufpe.cin.plp.eseml.impl;

import br.ufpe.cin.plp.eseml.EsemlPackage;
import br.ufpe.cin.plp.eseml.HypothesisLeftOperand;
import br.ufpe.cin.plp.eseml.HypothesisOperand;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Hypothesis Left Operand</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.ufpe.cin.plp.eseml.impl.HypothesisLeftOperandImpl#getHypothesisOperand <em>Hypothesis Operand</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HypothesisLeftOperandImpl extends MinimalEObjectImpl.Container implements HypothesisLeftOperand
{
  /**
   * The cached value of the '{@link #getHypothesisOperand() <em>Hypothesis Operand</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHypothesisOperand()
   * @generated
   * @ordered
   */
  protected HypothesisOperand hypothesisOperand;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HypothesisLeftOperandImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return EsemlPackage.Literals.HYPOTHESIS_LEFT_OPERAND;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public HypothesisOperand getHypothesisOperand()
  {
    return hypothesisOperand;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetHypothesisOperand(HypothesisOperand newHypothesisOperand, NotificationChain msgs)
  {
    HypothesisOperand oldHypothesisOperand = hypothesisOperand;
    hypothesisOperand = newHypothesisOperand;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND, oldHypothesisOperand, newHypothesisOperand);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setHypothesisOperand(HypothesisOperand newHypothesisOperand)
  {
    if (newHypothesisOperand != hypothesisOperand)
    {
      NotificationChain msgs = null;
      if (hypothesisOperand != null)
        msgs = ((InternalEObject)hypothesisOperand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND, null, msgs);
      if (newHypothesisOperand != null)
        msgs = ((InternalEObject)newHypothesisOperand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND, null, msgs);
      msgs = basicSetHypothesisOperand(newHypothesisOperand, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND, newHypothesisOperand, newHypothesisOperand));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND:
        return basicSetHypothesisOperand(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND:
        return getHypothesisOperand();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND:
        setHypothesisOperand((HypothesisOperand)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND:
        setHypothesisOperand((HypothesisOperand)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_LEFT_OPERAND__HYPOTHESIS_OPERAND:
        return hypothesisOperand != null;
    }
    return super.eIsSet(featureID);
  }

} //HypothesisLeftOperandImpl
